<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
    <!-- app就是根容器-->
    <div id="app">
        <!-- 调用方法:方法名 加括号 -->
        <h1>{{ greet() }}</h1>
        <!-- 传参 -->
        <h2>{{greetParam('Afternoon')}}</h2>

        <h3>{{ greetData('Night') }}</h3>
        <p>姓名：{{ name }}</p>
        <p>工作：{{job}}</p>
    </div>
    <script>
        // 实例化VUE对象
            new Vue({
                el: "#app",
                data: {
                    name: "小明",
                    job: "web开发"
                },
                methods: {
                    greet: function () {
                        return "Good Morning!";
                    },
                    // 传参
                    greetParam: function (param) {
                        return "Good " + param + "!";
                    },
                    greetData: function (time) {
                        return "Good " + time + " " + this.name + "!";
                    }
                }
            })

/* 
* el: element 需要获取的元素，是html的根容器元素     
* data: 用于数据 存储
methods: 定义方法
*/
    </script>
</body>
</html>